The present disclosure relates generally to virtual systems, and more particularly, to virtual processor management.
A virtual machine is a piece of software that, when executed on appropriate hardware, creates an environment allowing the virtualization of an actual physical computer system. Each virtual machine may function as a self-contained platform, running its own operating system (OS) and software applications (processes).
A host machine (e.g., computer or server) is typically enabled to simultaneously run one or more virtual machines, where each virtual machine may be used by a local or remote client. The host machine allocates a certain amount of the host's resources to each of the virtual machines. Each virtual machine may use the allocated resources to execute applications, including operating systems known as guest operating systems.
A hypervisor virtualizes the underlying hardware of the host machine or emulates hardware devices, making the use of the virtual machine transparent to the guest operating system or the remote client that uses the virtual machine. Typically, a hypervisor manages allocation and virtualization of computer resources such as processor resources. A physical processor generally may be in one of many sleep states as defined by the Advanced Configuration and Power Interface (ACPI) specification. The ACPI specification is an open standard for device configuration and power management by an operating system. The ACPI defines various C states for a processor. For example, C0 is the operating state, C1 is a halt state that can be readily exited, returning the processor to the operating state. The ACPI defines further C states, C2, C3, etc. that define deeper processor sleep states.
A hypervisor does not allow a virtual machine to control the sleep state of the physical processor. Thus, the hypervisor only reports a single C state to the virtual machine. But, this can lead to inefficiencies when managing multiple virtual machines. For example, a virtual processor may be waiting on an event before executing further instructions. During this wait time, the virtual processor does not need to be utilizing the physical resources of the host machine. It is desirable to have more flexibility with sleep states of a virtual processor.